import request from '@/utils/request'

// 查询原材料订单列表
export function listOrder(query) {
  return request({
    url: '/materials/order/list',
    method: 'get',
    params: query
  })
}

// 查询原材料订单详细
export function getOrder(orderId) {
  return request({
    url: '/materials/order/' + orderId,
    method: 'get'
  })
}

// 新增原材料订单
export function addOrder(data) {
  return request({
    url: '/materials/order',
    method: 'post',
    data: data
  })
}

// 修改原材料订单
export function updateOrder(data) {
  return request({
    url: '/materials/order',
    method: 'put',
    data: data
  })
}

// 下单交付提交按钮
export function updateOrderQuantity(data) {
  return request({
    url: '/materials/order/updateOrderQuantity',
    method: 'put',
    data: data
  })
}

// 转交到货提交按钮
export function handOverTOActualArrival(data){
  return request({
    url:'/materials/order/handOverTOActualArrival',
    method:'put',
    data:data
  })
}

// 删除原材料订单
export function delOrder(orderId) {
  return request({
    url: '/materials/order/' + orderId,
    method: 'delete'
  })
}
